<!DOCTYPE html>

<html lang="en">

<head>

	<meta charset="UTF-8">

	<title>代约私教</title>

	<meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0.maximum-scale=1.0,user-scalable=no"
		name="viewport">

	<link rel="stylesheet" href="css/reset.css">

	<link rel="stylesheet" href="css/bosscoach.css">

	<link rel="stylesheet" href="css/flexible.css">

	<link rel="stylesheet" href="css/vant.css">

	<script src="js/vue/vue.js"></script>

	<script src="js/jquery-3.3.1.min.js"></script>

	<script src="js/fontsize.js"></script>

	<script src="js/vue/axios.js"></script>

	<script src="js/jquery.md5.js"></script>

	<script src="js/glabe.js"></script>

	<script src="js/vue/qs.js"></script>

	<script src="js/vue/vant.js"></script>

	<script src="js/comment.js"></script>

	<style>
		.container_box {

			font-size: 0.14rem;

		}
	</style>

</head>

<body>

	<div class="container_box" id="app">

		<header>

			<div class="search bar3" style="width:100%;margin-bottom:0;">

				<form @submit.prevent action="#">

					<input @keyup.enter.native="search" v-model="from.phone" type="search" placeholder="搜索会员姓名/手机号码"
						style="font-size: 0.14rem;">

					<button @click="search" type="text"><img src="images/search.png"></button>

				</form>

			</div>

		</header>

		<van-list v-model="loading" :finished="finished" :immediate-check="false" finished-text="没有更多了" @load="onLoad"
			:offset="10">

			<van-cell class="group_details group_details_state clearfix" v-for="item in dataList" :key="item.id">

				<div class="fl head_card">

					<img :src="item.Picurl ? item.Picurl : 'images/moren.png'" alt="" class="spinning_img">

				</div>

				<div class="spinning_txt fl content_right">

					<p class="margin_bottom" style="display: flex;align-items: center;">

						<span style="font-size:0.14rem">{{item.Username}}</span>

						<img src="images/women.png" v-if="item.Sex=='0'"
							style="width: 0.14rem;height: 0.14rem;margin-left: 0.1rem;">

						<img src="images/man.png" v-else style="width: 0.14rem;height: 0.14rem;margin-left: 0.1rem;">

					</p>

					<p style="margin-bottom: 0.1rem;">

						<span class="spinning_name">{{item.Phone}}</span>

					</p>

					<div class="dyy" @click="toNext(item.Uid)">代预约</div>

				</div>

			</van-cell>
		</van-list>

	</div>

</body>

<script>

	$(".quit").on('click', function () {

		$(".logo").toggle();

	})

	function tiaozhuan() {

		window.location.href = '私教预约.html'

	}

</script>

<script>

	var app = new Vue({

		el: '#app',

		data: {

			dataList: null,

			from: {

				phone: '',

				page: '1'

			},

			lists: [],

			loading: false,

			finished: false,

			totalnum: '',

			totalpage: '',

			listd: [],

		},

		created() {

			//获取数据

			axios.get('mobileapi/boss/curr.php?act=user_list').then(res => {

				if (res.data.code == 200) {

					this.dataList = res.data.data.list;

				} else {

					vant.Toast(res.data.msg);

				}

			}).catch(err => {

				vant.Toast('请求发送失败，请重试');

			})

		},

		methods: {

			toNext(id) {

				window.location.href = 'dysj.html?uid=' + id;

			},

			getList() {

				const params = this.from

				axios.get('mobileapi/boss/curr.php?act=user_list', { params: params }).then(res => {

					let { msg, code } = res.data

					if (code !== 200) {

						vant.Toast('请求发送失败，请重试')

					} else {

						data = res.data

						this.listd = data.data.list

						this.totalnum = data.data.totalnum

						this.from.page = parseInt(data.data.page) + 1

						for (let i in this.listd) {

							if (this.listd[i].Picurl == "" || this.listd[i].Picurl == null) {

								this.listd[i].Picurl = 'images/moren.png'

							}

						}

						for (let i = 0; i < this.listd.length; i++) {

							this.dataList.push(this.listd[i])

						}

						// 加载状态结束

						this.loading = false

						// 数据全部加载完成

						if (this.dataList.length >= this.totalnum) {

							this.finished = true

						}

					}

				}).catch(err => {

					vant.Toast('请求发送失败，请重试')

				})

			},
			onLoad() {
				this.from.page++;
				this.getList();
			},
			search() {

				this.listd = []

				this.dataList = []

				this.from.page = '1'

				this.getList()

			}

		},

	})

</script>

</html>